package com.lz.redis.common.utils;

import java.time.LocalTime;
import java.util.Comparator;

/**
 * @author: zip.li
 * @date: Created in 2023/7/13 11:25
 * @Description:
 */
public class TimeComparator implements Comparator<String> {

    @Override
    public int compare(String time1, String time2) {
        LocalTime localTime1 = LocalTime.parse(time1);
        LocalTime localTime2 = LocalTime.parse(time2);
        return localTime1.compareTo(localTime2);
    }
}
